// pages/mine/mine.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    active: 1,
    items: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },
  showActionSheet: function (event) {
    wx.showActionSheet({
      itemList: ['删除'],
      success: res => {
        let index = Number(event.currentTarget.dataset.index)
        let items = this.data.items.filter ((item,idx) => {
          if (idx === index) {
            return false;
          }
          return true;
        })
        console.log(items);
        this.setData({
          items: items
        })
      },
      fail: function (res) {
        console.log(res.errMsg)
      }
    })
  },
  changeTab: function (event) {
    this.setData({
      active: Number(event.currentTarget.dataset.active)
    })
  }
})